The USB was initially specified as an industry-standard extension to the personal computer (PC) architecture to allow connection to a host of up to 127 peripheral devices. Since its introduction, the USB standard has been widely applied in PC-type hosts for use with PC-type peripheral devices, and increasingly it is being applied in hosts and devices beyond the traditional PC field. FIG. 1 (prior art) is a schematic diagram depicting a typical USB architectural configuration.
The current specification for USB is defined in the document UNIVERSAL SERIAL BUS SPECIFICATION, Rev. 2.0, Apr. 27, 2000, by Compaq Computer Corporation, Hewlett-Packard Company, Intel Corporation, Lucent Technologies Inc., Microsoft Corporation, NEC Corporation, and Koninklijke Philips Electronics N.V. (hereinafter the “USB specification”).
FIG. 2 (prior art) is a schematic diagram depicting some key features of an exemplary USB connection 10. Here a USB host 12 has a USB port 14 (including a connector) to which a USB cable 16 can be attached to connect a USB-capable peripheral device (USB device 18). The USB device 18 includes conventional circuitry 20, to operate its USB functions as well as for whatever utilitarian functions it provides.
The USB cable 16 and the USB device 18 can be integrated, as shown in FIG. 2, or they may be distinct devices in their own right (in which case the USB device 18 will include a connector of its own to receive its end of the USB cable 16). It should also be noted that a large class of USB devices 18 now also exist that connect directly to a USB port 14. In fact, a sub-class of these devices are protocol converters that permit direct or cabled connection of non-USB devices to USB ports 14. Furthermore, the USB specification provides for a hierarchical arrangement of one or more USB hubs between a USB host 12 and any ultimate end USB devices 18 (see e.g., FIG. 1, wherein a USB-capable keyboard accepts keyed input and serves as a USB hub to a USB-capable mouse and a USB-capable pen input device). USB hubs and USB devices that are “downstream” from a given USB port are therefore sometimes collectively termed “USB slave devices.”
While FIG. 2 is merely representative, it illustrates a salient feature of all USB connections. The USB specification defines a 4-conductor scheme, including a data+ conductor 22, a data− conductor 24, a ground conductor 26, and a VBUS conductor 28. When active, the VBUS conductor 28 is nominally powered at +5V by the USB host 12. By virtue of the ground conductor 26 and the VBUS conductor 28 it is thus optionally possible to power one or more USB devices 18. Some USB devices 18 even employ this feature parasitically, to recharge their own internal power supplies for use later when the USB device 18 is disconnected from the USB port 14.
USB devices that rely on power from the cable are called “bus-powered devices” and those that have an alternate source of power are called “self-powered devices.” Furthermore, some USB devices are capable of operation in either bus-powered or self-powered modes, and some can selectively operate in either mode, depending on whether a USB port appears to be able to supply their power needs.
The USB specification dictates that a USB port must be able to supply a minimum of 100 mA at 5V on the VBUS circuit. Optionally, the USB port can support high-power devices that can draw up to 500 mA at 5V. When a USB device is first connected to a USB port, it must limit its power draw to the 100 mA minimum. As described in the USB specification, a USB host enumerates a USB device first in low-power mode, and determines its maximum configurable power draw. The USB device may report multiple power configurations, each requiring different power draw amounts. For example, the USB device may report a low power configuration for use with low power USB ports as well as a high-power configuration where it might enable a battery charger or other high-current function when connected to a USB port that can supply the extra power. After the USB host enumerates the USB device power configuration options, it can then set the USB device to use the highest-power configuration that is supported by the USB port that the USB device is attached to.
The challenge that arises is that some USB hosts, notably those running variants of the Microsoft Windows™ operating system, do not enumerate multiple USB device configurations. These USB hosts simply use the first configuration reported by the USB device. If the USB port cannot support the power requirements reported by the first USB device configuration, then the USB host will not configure the USB device and it becomes unusable on that USB port.
One solution to this problem is for the device to report a lower power requirement than it plans to use. This tricks the USB host into allowing the USB device to be configured on a USB port that may not supply enough power. Depending on the USB port such a USB device is attached to, this can lead to voltage sags on the VBUS and erratic USB device operation. Also, a USB device that draws more current than it reports in its configuration descriptors will not pass USB certification testing and cannot be sold with the USB-compatible logo.
Given that the USB specification makes no provision for a USB device to discover any of the characteristics of a USB port that it is attached to, and furthermore, given that many USB hosts will not correctly determine the amount of power that can be used by a USB device, what is sorely needed are mechanisms by which a USB device can independently determine the capabilities of an upstream USB port and manage its power draw accordingly.